package com.zhouheng.springbootdesignpattern.strategicpattern;

import java.math.BigDecimal;

/**
 * 报价上下文类
 * <p>
 * 通常一个策略模式都会有其对应的枚举值，通过不会直接传入策略实现类，而是传入枚举值再通过工厂模式获取对应实现类
 *
 * @author 周恒
 * @date 20190614 15:06:09
 * @since v1.0
 */
public class QuoteContext {

    private IQuoteStrategy quoteStrategy;

    public QuoteContext(IQuoteStrategy quoteStrategy) {
        this.quoteStrategy = quoteStrategy;
    }

    public BigDecimal getPrice(BigDecimal bigDecimal) {
        return quoteStrategy.getPrice(bigDecimal);
    }

}
